package com.csd.action.manager;

import com.csd.helper.ActionResult;
import com.csd.pojo.ChangeRecord;
import com.csd.service.IChangeRecordService;;

/**
 * 受理或驳回
 * @author sanmu
 *	<br> 创建于2009-12-17
 */
public class ChangeRecordHandleAction {

	private Integer changeRecordID;
	
	private String result ;
	
	private IChangeRecordService changeRecordService;

	public Integer getChangeRecordID() {
		return changeRecordID;
	}

	public void setChangeRecordID(Integer changeRecordID) {
		this.changeRecordID = changeRecordID;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public IChangeRecordService getChangeRecordService() {
		return changeRecordService;
	}

	public void setChangeRecordService(IChangeRecordService changeRecordService) {
		this.changeRecordService = changeRecordService;
	}

	public String execute() throws Exception {
		//System.out.println(result+"============5555==========="+changeRecordID);
		String text = ActionResult.fail;
		boolean bl = false;
		//更新变更处理结果
		bl = changeRecordService.changeRecoedHandleOfManager(result, getChangeRecordID());
		if (bl && result.equals("1")) {
			text = "pass";		//通过请求，跳转到通过列表
		}
		else if (bl && result.equals("0")) {
			text = "reject";		//驳回请求，跳转到驳回列表
		}
		return text;
	}
}
